package com.ebupt.migu.music.system.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.ebupt.migu.music.system.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: workorder
 * @description: 运营支撑系统用户数据库操作类
 * @author: zhanggk
 * @create: 2019-01-24 16:41
 **/
@DS("mysql_mg")
@Mapper
public interface UserMapper {

    List<SysUser> queryByPage(Map<String,Object> paramMap);

    Integer queryCount(Map<String,Object> paramMap);

    Integer addUser(Map<String,Object> paramMap);

    Integer addUserRole(Map<String,Object> paramMap);

    Integer delUser(Map<String,Object> paramMap);

    Integer delUserRole(Map<String,Object> paramMap);

    Integer modifyUser(Map<String,Object> paramMap);

    Integer isUserExist(String userId, String oldPWD);

    void updatePWD(String userId, String newPWD);

    /**
     * 同步用户数据
     *
     * @param sysUser 用户信息
     */
    void syncAccount(@Param("u") SysUser sysUser);

    /**
     * 查询用户邮箱
     * @return
     */
    List<HashMap<String, Object>> queryEmails();
}
